package com.yc.admin.controller.system;

import com.yc.common.core.domain.AjaxResult;
import com.yc.system.dto.StudentDto;
import com.yc.system.service.IStudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
@Api("学生")
public class StudentController {

    @Autowired
    @Qualifier("studentService")
    private IStudentService studentService;

    @GetMapping("/all")
    @ApiOperation("获取全部学生相关信息")
    public AjaxResult queryAllStudentInfo() {
        AjaxResult ajax = AjaxResult.success();

        List<StudentDto> stuList = studentService.findAll();

        return ajax.put("stuList", stuList);
    }
}
